<template>
  <div>
    <h2>{{this.$root.testname}}</h2>
    <button @click="getmeth">获取root方法</button>
  </div>
</template>

<script>
export default {
  name: "home",
  methods: {
    getmeth() {
      let msg = this.$root.testShow();
      console.log("msg" + msg);
    },
  },
};
</script>